$(function() {
	//随机数函数
	function randomNum(x, y) {
		return parseInt(Math.random() * (y - x + 1) + x)
	}
	var timeNum = 10;
	var clickNum = 0;

	function timeShow() {
		var time = setInterval(function() {
			timeNum--;
			$(".a_btn1").html("倒计时" + timeNum + "s")
			if(timeNum <= 0) {
				timeNum = 10;
				clickNum = 0;
				clearInterval(time);
				$(".a_btn1").html("获取验证码")
			}

		}, 1000)
	}

	$(".a_btn1").on("click", function() {
		clickNum++;
		if(clickNum == 1) {
			timeShow();
			$(".c_code").show();
			$(".c_codeCon>i").html(randomNum(0,9)+" "+randomNum(0,9)+" "+randomNum(0,9)+" "+randomNum(0,9));
			$(".c_close>i").on("click", function() {
				$(".c_code").css("display", "none");
			})
		}else{
			window.confirm("请勿重复获取")
		}

	})
})